<h2 class="dialog_title"><span>Total Point Karyawan</span></h2>
<div class="dialog_content" style="padding: 10px 20px; width:700px">
<?php $res = mysql_fetch_assoc(kary_load($kary_id))?>
<table width="100%" border="0" cellpadding="5" cellspacing="0">
	<tr>
	  <td align="right" width="70">Karyawan : </td>
	  <td><strong><?php echo $res['NAMA_KARYAWAN'] ?></strong></td>
    </tr>
	<tr>
		<td align="right" >Periode : </td>
		<td><strong><?php echo $month ?> - <?php echo $year ?></strong></td>
	</tr>
</table>
<table style="border:1px solid #457A3F;" width="100%" border="0" cellpadding="5" cellspacing="0">
  <tr class="header">
  	<th align="left"><span class="colorWhite">Tgl Lapor</span></th>
    <th align="left"><span class="colorWhite">Jenis</span></th>
    <th align="left"><span class="colorWhite">Bidang</span></th>
    <th align="left"><span class="colorWhite">Tingkat</span></th>
    <th align="left"><span class="colorWhite">Kategori</span></th>
    <th align="right"><span class="colorWhite">Perbuatan Ke</span></th>
    <th align="right"><span class="colorWhite">Point</span></th>  
  </tr>
  <tbody id="searchKary-table" style="overflow:scroll; height:200px; max-height: 500px">
<?php
	//variable penghitung jumlah point
	$pointCount = 0;
	 
	/*
	 * 1. load ranking untuk 1 periode sebelumnya
	 */
//	$rank = rank_select(false, 
//		"a.KODE_KARYAWAN='$kary_id' 
//		AND MONTH(a.RANK_PERIODE)=$month-1 AND YEAR(a.RANK_PERIODE)='$year'");
//	$rank = mysql_fetch_assoc($rank);

	/*
	 * 2. daftar perbuatan untuk periode ini
	 */
	$data = perb_select_corelate2(false, 
		"a.KODE_KARYAWAN='$kary_id' AND 
			YEAR(a.PERB_TGL) = '$year' AND MONTH(a.PERB_TGL)='$month'", 
		"a.PERB_TGL");
?>
<?php while ($row = mysql_fetch_assoc($data)): ?>
<?php $pointCount += $row['PERB_POINT']; ?>
  <tr <?php echo tag_zebra($z++)?>>
  	<td><?php echo $row['PERB_TGL']?></td>
  	<td><?php echo $row['ACHIEV_JENIS']?></td>
    <td><?php echo $row['ACHIEV_BIDANG']?></td>
    <td><?php echo $row['DETACHIEV_TINGKAT']?></td>
    <td><?php echo $row['DETACHIEV_NAMA']?></td>
    <td align="right"><?php echo $row['DEPERB_COUNT']?></td>
    <td align="right"><?php echo $row['PERB_POINT']?></td>
  </tr>
<?php endwhile;?>
  </tbody>
  <!-- <tr class="header">
    <th align="right" colspan="6"><span class="colorWhite">Jumlah Point : </span></th>
    <th align="right"><span class="colorWhite"><?php echo $pointCount ?></span></th>  
  </tr> -->
  <!-- <tr class="header">
  	<th align="right" colspan=6"><span class="colorWhite">Point Periode <?php echo ($month-1).'-'.$year?> : </span></th>
    <th align="right"><span class="colorWhite"><?php echo $rank['RANK_POINT']? $rank['RANK_POINT'] : 0 ?></span></th>
  </tr> -->
  <tr class="header">
  	<th align="right" colspan=6"><span class="colorWhite">Total Point : </span></th>
    <th align="right"><span class="colorWhite"><?php echo $pointCount += $rank['RANK_POINT']? $rank['RANK_POINT'] : 0 ?></span></th>
  </tr>
</table>
</div>
<div class="dialog_buttons"><input type="button" value="Close" name="close" onclick="FBModal_hide()" /></div>